/* ==========================================================================
   Custom Task Type Modal Styles
   ========================================================================== */

/* Custom Task Type Modal */
.custom-task-type-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out; /* Fade in animation */
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  backdrop-filter: blur(2px); /* Slight blur effect for depth */
  transition: opacity 0.2s ease; /* Smooth transition when closing */
}

.custom-task-type-modal {
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  width: 800px;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.2s ease-in-out;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.custom-task-type-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-primary);
}

.custom-task-type-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.custom-task-type-modal-header .close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}

.custom-task-type-modal-content {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background-color: var(--background-primary);
}

/* Form styles */
.task-type-form {
  border-right: 1px solid var(--border-color);
  padding-right: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.2);
}

.validation-error {
  color: var(--error-color);
  font-size: 14px;
  margin-top: 8px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-button,
.save-button {
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.cancel-button {
  background-color: var(--background-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.save-button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.cancel-button:hover {
  background-color: var(--hover-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.save-button:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Task Type List */
.existing-task-types {
  overflow-y: auto;
}

.existing-task-types h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.no-task-types {
  color: var(--text-muted);
  font-style: italic;
  padding: 16px;
  text-align: center;
  background-color: var(--hover-bg);
  border-radius: 4px;
}

.task-type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.task-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 6px;
  background-color: var(--hover-bg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.task-type-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task-type-info {
  flex: 1;
}

.task-type-name {
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 4px;
}

.task-type-description {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.task-type-actions {
  display: flex;
  gap: 8px;
}

.edit-button,
.delete-button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.1s;
}

.edit-button:active,
.delete-button:active {
  transform: scale(0.95);
}

.edit-button {
  background-color: var(--background-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.delete-button {
  background-color: rgba(65, 40, 44, 0.242);
  color: var(--error-color);
  border: 1px solid var(--error-color-light);
  box-shadow: var(--shadow-sm);
}

.edit-button:hover {
  background-color: var(--hover-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.delete-button:hover {
  background-color: var(--error-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Dark mode adjustments */
.dark-mode .custom-task-type-modal {
  background-color: var(--bg-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dark-mode .custom-task-type-modal-header h2 {
  color: var(--text-color);
}

.dark-mode .custom-task-type-modal-content {
  background-color: var(--background-primary);
}

.dark-mode .form-group label {
  color: var(--text-color);
}

.dark-mode .form-group input,
.dark-mode .form-group textarea {
  background-color: var(--input-bg);
  color: var(--text-color);
}

.dark-mode .task-type-item {
  background-color: var(--hover-bg);
}

.dark-mode .task-type-name {
  color: var(--text-color);
}

.dark-mode .task-type-description {
  color: var(--text-muted);
}

.dark-mode .no-task-types {
  background-color: var(--bg-color-lighter);
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .custom-task-type-modal-content {
    grid-template-columns: 1fr;
  }

  .task-type-form {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
  }
}
